<?php

	/* SVN FILE: $Id: const.inc.php 72 2011-01-24 22:03:04Z andreoletti $ */
	
	/**
	 * Project Name : arcadia
	 *
	 * @author $Author: andreoletti $
	 * @version $Revision: 72 $
	 * @lastrevision $Date: 2011-01-24 23:03:04 +0100 (lun, 24 gen 2011) $
	 * @filesource $URL: http://svn.fletchlynd.com/arcadia/trunk/addressbook/include/const.inc.php $
	 */
	 
	include_once '../include/const.inc.php';

	if (!isset($sAPP)) $sAPP = whichApp();
	
	foreach ($aSUITE[$sAPP] as $sKey => $sValue) {
		$$sKey = $sValue;
	}

	$sFAVICON = "addressbook.png";
		
	$sTABLE_DEFAULT = 'contatti';
	$aTABLE_SECURITY_CHECK = array("contatti", "trash");
		// $sTable per i cui record viene eseguita una verifica sui diritti di accesso
		// quando si esegue lo script $sViewItemLink

	$iTABLE_DISPLAY_LENGTH = 10;
		// numero di item visualizzati nella tabella 'main-table'
	$iTABLE_STRING_MAX_LENGTH = 40;
		// max numero di caratteri di una stringa visualizzabili nella tabella in index.php
		
	$bSEARCH_FORM_SHOW = true;
	$sSEARCH_FORM_LABEL = "Ricerca...";
	$sSEARCH_JSON_OUTPUT = "IF(sFirstname<>'',CONCAT_WS(' ',sLastname,sFirstname), sLastname)";

	$aWITH_LINK_TO_VIEW = array("sContact", "sCompany");
	$aWITH_CURRENCY_VALUE = array();
	$aWITH_TOOLTIP = array('iShowDetails','iShowNote');
	
	$iMAX_DAYS_IN_TRASH = 60;
		// giorni dopo i quali un record nel cestino viene cancellato definitivamente
	
	$aRESOURCES_APP = array();
	
	//	
	// index.php (mainlist)
	//

	$aTABLE['contatti']['sTableName'] = 'Contatti';
		$aTABLE['contatti']['sTableDescription'] = 'Tutti i contatti';
		$aTABLE['contatti']['sTableIcon'] = 'group.png';
		$aTABLE['contatti']['sTableSelectFrom'] = 'addressbook';
		$aTABLE['contatti']['sTableSelectWhere'] = " (`iTrash`='0') AND (IF(`iNotShared`='1', IF(`sCreatedby`='_USERNAME_', '1', '0'), '1')) ";
		$aTABLE['contatti']['sTableSelectGroupBy'] = '';
		$aTABLE['contatti']['sViewItemLink'] = 'view.php';
		$aTABLE['contatti']['sNewItemLabel'] = 'Nuovo Contatto';
		$aTABLE['contatti']['sNewItemLink'] = 'view.php';
		$aTABLE['contatti']['aSearchFields'] = array(	"IF(sFirstname<>'',CONCAT_WS(' ',sLastname,sFirstname), sLastname)",
														"IF(sFirstname<>'',CONCAT_WS(' ',sFirstname,sLastname), sLastname)",
														'sField_1',
														'sField_2',
														'sField_3',
														'sField_4',
														'sCompany',
														'sDepartment',
														'sJobtitle',
														'sNote');
		$aTABLE['contatti']['aSummaryTable']['bShow'] = false; 	
		$aTABLE['contatti']['bShowLink2Report'] = false;
		$aTABLE['contatti']['bShowLink2ExcelExport'] = true;
		$aTABLE['contatti']['aNegativeValueHighlight'] = array();
		$aTABLE['contatti']['aExpiredValueHighlight'] = array();		
		$aTABLE['contatti']['iShow'] = 1;
	
	$aTABLE['trash']['sTableName'] = 'Cestino';
		$aTABLE['trash']['sTableDescription'] = 'Contatti eliminati';
		$aTABLE['trash']['sTableIcon'] = 'trash.png';
		$aTABLE['trash']['sTableSelectFrom'] = 'addressbook';
		$aTABLE['trash']['sTableSelectWhere'] = " (`iTrash`='1') AND (IF(`iNotShared`='1', IF(`sCreatedby`='_USERNAME_', '1', '0'), '1')) ";
		$aTABLE['trash']['sTableSelectGroupBy'] = '';
		$aTABLE['trash']['sViewItemLink'] = 'view.php';
		$aTABLE['trash']['sNewItemLabel'] = 'Nuovo Contatto';
		$aTABLE['trash']['sNewItemLink'] = 'view.php';
		$aTABLE['trash']['aSearchFields'] = $aTABLE['contatti']['aSearchFields'];
		$aTABLE['trash']['aSummaryTable']['bShow'] = false; 	
		$aTABLE['trash']['bShowLink2Report'] = false;
		$aTABLE['trash']['bShowLink2ExcelExport'] = true;
		$aTABLE['trash']['aNegativeValueHighlight'] = array();
		$aTABLE['trash']['aExpiredValueHighlight'] = array();		
		$aTABLE['trash']['iShow'] = 1;
	
	//
	// view.php
	//

	if (!isset($iView)) $iView = 0;
	$aData = array();
	$sAction = "view";
	$sTableTitle = "Nuovo Contatto";
	
	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['sViewSelectFrom'] = $aTABLE[$sTABLE_DEFAULT]['sTableSelectFrom'];
	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['sViewSelectGroupBy'] = $aTABLE[$sTABLE_DEFAULT]['sTableSelectGroupBy'];

	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['iTabDefault'] = 1;
	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['iTabUploads'] = 2; // impostare a 0 se non esiste un tab 'uploads'
	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['aTabsLabels'] = array('1' => 'Scheda|user_suit.png', '2' => 'Allegati|attach.png');
																				
	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['bTagsShow'] = false;
	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['sTagsType'] = '';
																											
	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['aDelVerifyText'][] = array('sLastname', 'sFirstname');
	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['aDelVerifyText'][] = array('sCompany');	
	
	// $aVIEW[$sViewItemLink]['aForms'][$iTab]['sFormTable']
	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['aForms']['1']['sFormTable'] = 'addressbook';	
	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['aForms']['1']['aFormFieldsMandatory'] = array('sLastname');
	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['aForms']['1']['sFormFieldsAutoIncrement'] = '';
	$aVIEW[$aTABLE[$sTABLE_DEFAULT]['sViewItemLink']]['aForms']['1']['aFormFields'] 	= array(	'id',
																									'sPrefix',
																									'sLastname',
																									'sFirstname',
																									'sField_1',
																									'sField_2',
																									'sField_3',
																									'sField_4',																										
																									'sCompany',
																									'sDepartment',
																									'sJobtitle',
																									'sNote',
																									'sCreatedby');	

	//
	// selInput $aOptions
	//
	
	$aNAME_PREFIX = array('Dr.','Dr.ssa','Prof.', 'Sig.','Sig.ra','Ing.','Lup.Mann.', 'Gran Farabut.');
	
?>